/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB3D_HARD_MATERIAL_H__
#define __LIB3D_HARD_MATERIAL_H__

#include <Color.h>

namespace liba
{
namespace lib3d
{
namespace hard
{

class Material
{
public:
	enum BlendFunc
	{
		ZERO,
		ONE,
		SRC_COLOR,
		ONE_MINUS_SRC_COLOR,
		SRC_ALPHA,
		ONE_MINUS_SRC_ALPHA,
		DEST_ALPHA,
		ONE_MINUS_DEST_ALPHA,
		DEST_COLOR,
		ONE_MINUS_DEST_COLOR,
		SRC_ALPHA_SAT
	};

	Color diffuse;
	Color ambient;
	Color emissive;
	Color specular;
	double specular_power;
	double transparency;
	bool double_sided;

	BlendFunc source_blend;
	BlendFunc dest_blend;

	Material()
	:	specular_power( 0 ),
		double_sided( false ),
		transparency( 0 ),
		source_blend( SRC_ALPHA ), 
		dest_blend( ONE_MINUS_SRC_ALPHA ),
		diffuse( 0, 0, 0 ),
		ambient( 0, 0, 0 ),
		emissive( 0, 0, 0 ),
		specular( 0, 0, 0 )
	{}
};

} // namespace hard
} // namespace lib3d

namespace converter
{
extern EnumPair<char,lib3d::hard::Material::BlendFunc> Lib3DHardMaterialBlendFuncNames[];

template<>
struct ConverterTraits<char,lib3d::hard::Material::BlendFunc>
	:	public ConverterTraitsEnumBase<char, lib3d::hard::Material::BlendFunc, Lib3DHardMaterialBlendFuncNames>
{};
template<>
struct ConverterTraitsSelector<lib3d::hard::Material::BlendFunc> : public ConverterTraitsSelectorLocalBase<lib3d::hard::Material::BlendFunc>
{};

} // namespace converter

} // namespace liba
using namespace liba;

#endif //__LIB3D_HARD_MATERIAL_H__

